import pymysql
class Mysql():
    def __init__(self,host,user,password,database):
        self.con = pymysql.connect(host=host,user=user,password=password,database=database)
        self.cur = self.con.cursor()
    def chaxun(self,sql):
        self.cur.execute(sql)
        return self.cur.fetchall()
    def guanbi(self):
        self.cur.close()
        self.con.close()